package com.org.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.URL;

import java.time.LocalDateTime;

/**
 * ClassName: Community
 * Package: com.org.pojo
 * Description:
 *
 * @Author Origin
 * @Create 2024/2/2 10:11
 * @Version 1.0
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("community")
public class Community {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id; //主键id

    @NotEmpty
    private String province;    //省份

    @NotEmpty
    private String city;    //市

    @NotEmpty
    private String districtOrCountry;   //区或县

    @NotEmpty
    private String name;    //街道或社区名字

    @NotNull
    private Integer createUserId;   //创建人

    @TableField(value = "`describe`")
    private String describe;    //描述

    @URL
    @TableField(value = "`describeImg01`")
    private String describeImg01;   //照片01


    @URL
    @TableField(value = "`describeImg02`")
    private String describeImg02;   //照片02


    @URL
    @TableField(value = "`describeImg03`")
    private String describeImg03;   //照片03

    @URL
    @TableField(value = "`describeImg04`")
    private String describeImg04;   //照片04

    private String state;   //状态

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime createTime;//创建时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime updateTime;//更新时间

}
